package cn.itrip.auth.service;

import cn.itrip.auth.exception.DatabaseException;
import cn.itrip.auth.exception.LoginException;
import cn.itrip.beans.pojo.ItripUser;

/**
 * @Author: jxm
 * @Description:用户接口
 * @Date: 2020/3/11 21:09
 * @Version: 1.0
 */
public interface UserService {
    /**
     * 使用邮箱注册用户
     * @param user
     * @throws Exception
     */
    public void itriptxCreateUser(ItripUser user)throws Exception;

    /**
     * 使用手机号码注册
     * @param user
     * @throws Exception
     */
    public void itriptxCreateUserByPhone(ItripUser user) throws Exception;

    /**
     * 激活邮箱
     * @param mail 账户（即邮箱账号）
     * @param code 激活码
     * @return
     * @throws Exception
     */
    public boolean activate(String mail, String code) throws Exception;

    /**
     * 手机验证
     * @param phoneNum
     * @param code
     * @return
     * @throws Exception
     */
    public boolean validatePhone(String phoneNum, String code)throws Exception;

    /**
     * 根据用户账号查找用户
     * @param userCode
     * @return
     * @throws Exception
     */
    public ItripUser findUserByUserCode(String userCode) throws Exception;

    /**
     * 登录
     * @param userCode
     * @param password
     * @return
     * @throws Exception
     */
    public ItripUser checkLogin(String userCode,String password) throws DatabaseException,LoginException;


}
